Portions of this patent application include materials that are subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document itself, or of the patent application, as it appears in the files of the United States Patent and Trademark Office, but otherwise reserves all copyright rights whatsoever in such included copyrighted materials.
This invention generally relates to improvements in computer software and, more particularly, to dynamically settable bidirectional ports for use with object-oriented components
Object-oriented based programming (OOP) is probably the most arresting, stimulating and intriguing aspect of programming in today""s software world. Although it has been available for some time in languages such as Simula and SmallTalk and recently in C++ and Java, OOP has only recently taken hold as the hoped for solution to closing the gap between the theoretical capability of hardware and the general performance of software while simultaneously solving problems left over from prior software development approaches.
In the past, programming development which began with a single procedure approach, evolved to modular programming, went from there to structured programming and then branched off into computer aided software engineering (CASE) and program generators. All of these methodologies, while solving some or many of the difficulties inherent in prior approaches, introduced their own limitations and inefficiencies. Program bloat, data corruption and xe2x80x9cspaghettixe2x80x9d code were but a few of the problems that were caused or left unsolved by the aforementioned software development approaches.
In the early days of procedural programming, the programmer called libraries provided by the operating system to perform certain tasks, but basically the program executed down the page from start to finish, and the programmer was solely responsible for the flow of control. This was appropriate for printing out paychecks, calculating a mathematical table, or solving other problems with a program that executed in just one way.
The development of graphical user interfaces began to turn this procedural programming arrangement inside out. These interfaces allow the user, rather than program logic, to drive the program and decide when certain actions should be performed. Today, most personal computer software accomplishes this by means of an event loop which monitors the mouse, keyboard, and other sources of external events and calls the appropriate parts of the programmer""s code according to actions that the user performs. The programmer no longer determines the order in which events occur. Instead, a program is divided into separate pieces that are called at unpredictable times and in an unpredictable order. By relinquishing control in this way to users, the developer creates a program that is much easier to use. Nevertheless, individual pieces of the program written by the developer still call libraries provided by the operating system to accomplish certain tasks, and the programmer must still determine the flow of control within each piece after it""s called by the event loop. Application code still xe2x80x9csits on top ofxe2x80x9d the system.
Even event loop programs require programmers to write a lot of code that should not need to be written separately for every application. The concept of an application framework carries the event loop concept further. Instead of dealing with all the nuts and bolts of constructing basic menus, windows, and dialog boxes and then making these things all work together, programmers using application frameworks start with working application code and basic user interface elements in place. Subsequently, they build from there by replacing some of the generic capabilities of the framework with the specific capabilities of the intended application.
Into to this breach, entered Object-Oriented Programming (OOP) techniques which involve the definition, creation, use and destruction of xe2x80x9cobjects.xe2x80x9d Objects are self-sufficient software entities comprising data elements and routines, or functions, sometimes called methods, which are used to manipulate the data elements. The object""s data and related functions are treated by the software as an entity and they can be created, used and deleted as if they were a unitary item. Together, the data and functions enable objects to model virtually any real-world entity in terms of its characteristics, which can be represented by the data elements, and its behavior, which can be represented by its data manipulation functions. In this way, objects can model concrete things like people and computers, and they can also model abstract concepts like numbers or geometrical designs.
Objects are defined by creating xe2x80x9cclassesxe2x80x9d which are not per se objects themselves, but which act as templates that instruct a compiler how to construct an actual object. A class may, for example, specify the number and type of data variables and the steps involved in the functions which manipulate the data. An object is actually created in the program by means of a special function called a constructor which uses the corresponding class definition and additional information, such as arguments provided during object creation, to construct and initialize the object and its data members. Likewise objects are destroyed by a special function called a destructor. Objects are employed by using their data and invoking their functions to accomplish a task.
The concept of an object is predicated on and the benefits of object-oriented programming techniques arise from the use of three basic principles; those of encapsulation, polymorphism and inheritance. These principles work in conjunction with objects as described below. It is noteworthy to distinguish between an object and a class of objects. A class is a type definition or template used to create objects in programs. The objects so created are then merely each a single instance of the class of objects, which is often just called a class. A class has no memory or behavior of its own except to serve as the blueprint from which objects can be created.
An object is a self-sufficient component that includes both data and function. An object is of the same type as the class from which it has been derived. Objects are said to be instantations of their class and use memory for their data and functions, unlike the class template itself which does not.
Objects can be designed to hide, or encapsulate, all, or a portion of, their internal data structure and internal functions. OOP also allows a programmer to create an object that is a part of another object and thereby define assemblies and sub-assemblies, as may be required by a program or the situation or item it is modeling.
More particularly, during program design, a program developer can define objects in which all or some of the data variables and all or some of the related functions are considered xe2x80x9cprivatexe2x80x9d or made available for use only by the object itself. Other data or functions can be declared xe2x80x9cpublicxe2x80x9d or available for use by other objects or programs.
Further, access to private variables by other objects or programs can be controlled by defining public functions for an object which access the object""s private data. The public functions form a controlled and consistent interface between the private data and the xe2x80x9coutsidexe2x80x9d world. Any attempt to write program code which directly accesses the private variables causes the compiler to generate an error which stops the compilation process and prevents the program from being run.
Polymorphism is capability to conceal the different implementations behind a common interface. This means that separate objects of the same class can have different internal functions and data and implement received messages differently, but still produce uniform or consistent results. For example, an addition function may be defined as variable A plus variable B (A+B) and this same format can be used whether variables A and B represent numbers, characters or monetary units such as dollars and cents. However, the actual program code which performs the addition may differ widely depending on the type of variables that comprise A and B. Polymorphism allows three separate objects that employ different function definitions to be written, one for each type of variable (numbers, characters and dollars). After the functions have been defined, a program can later refer to the addition function by its common format (A+B) and, during compilation, the OOP based compiler will determine which of the three functions needs to be used by examining the variable types. The compiler will then substitute the proper function code in the object it compiles. Polymorphism allows similar functions that produce analogous results to be xe2x80x9cgroupedxe2x80x9d in the program source code to produce a more logical and clearer program flow.
The third principle which underlies object-oriented programming is that of inheritance. Inheritance allows program developers to easily reuse pre-existing programs or portions thereof to avoid creating software from scratch. The principle of inheritance allows a software developer to declare classes (and the objects which are later created from them) as related. Specifically, classes may be designated as subclasses of base classes. A subclass xe2x80x9cinheritsxe2x80x9d and has access to all of the public functions of its base classes just as if these functions appeared in the subclass. Alternatively, a subclass can override some or all of its inherited functions merely by defining a new function with the same form (overriding or modification does not alter the function in the base class, but merely modifies the use of the function in the subclass). The creation of a new subclass which has some of the functionality (with selective modification) of another class allows software developers to easily customize existing code to meet their particular needs while still taking advantage of reusing prior, usually debugged and well behaved code, rather than having to write and qualify new code of their own.
By utilizing the concepts of encapsulation, inheritance and polymorphism, an object can be made to accurately and independently representjust about anything in our world, real or simulated. In fact, the limits of our logical perceptions of such representation is the only restraint on the kinds of things that can become objects in object-oriented software. Some typical categories are as follows:
Objects can represent physical objects, such as airplanes in an air traffic control system, components in a stereo or television system, balance sheet and income statement elements in a fundamental analysis company business model, or stars in the simulated night sky on display at a planetarium;
Objects can represent elements of the computer-user environment such as windows, scrollbars, sliders, menus or other graphical items;
An object can represent a collection of data, such as a personnel file or a table of the latitudes and longitudes of cities; or
An object can represent user-defined data types such as time, angles, and complex numbers, functions or points on the plane.
While object-oriented programming offers significant improvements over other programming concepts in the design and development of programs, program development and program development tools, even within an OOP environment, still require significant outlays of time and effort. This is particularly true where the developer has to write a significant amount of code from scratch and is unable to take full advantage of the benefits of object oriented programming. The ability of development tools to negate or reduce the need to write code in the traditional sense and permit a developer to concentrate on development and visually interact with an enriched development tool is the focus and goal of the present invention.
It is usually the case that proponents of a particular type of programming language or of a specific language of that type are best able to advance their cause and the popularity and vitality of the language type or specific implementation or dialect of the language they support.
This is usually done by directly or indirectly providing appropriate tools that make use of the language type or a specific implementation of the language easy, practical and efficient. Visual Basic and Visual C++ are examples of two current programming environments with an object oriented foundation that have been developed and made available for programmers to use in creating applications for the Windows 3.x, Windows 95 and Windows NT platforms. While Visual Basic and Visual C++ undoubtedly make program development easier by including tools, called Wizards, that relieve the programmer of the necessity to write the underlying Basic or C++ code needed to create and implement such typical graphical user interface (GUI) elements as scrollbars, sliders, buttons or dialog boxes and to define their properties, these tools do not go far enough in easing the programmer""s development burden. For example, it is still necessary in either Visual Basic and Visual C++ for the programmer to write code that defines and controls the interrelationship of the elements selected for use in the program under development or to otherwise manually intercede in the object based xe2x80x9cpoint and clickxe2x80x9d or xe2x80x9cdrag and dropxe2x80x9d aspects of this program development process.
This is true in the development of general OOP based applications and also in development environments for creating Applets in a JAVA system. As the Java system and applet creation becomes more widely used, the need to simplify the development of these applications becomes desirable. In addition, while the developer in these prior art visual programming environments is given a Wizard that writes the underlying code to make an event involving one or more of the selected elements occur, the ability to simultaneously view and experience that interrelationship is not provided.
It would be desirable to provide the tool""s objects or components with bidirectional ports that can function as input or output pins in a dynamic fashion without specific user designation of their role to thereby conserve screen real estate, reduce clutter and ease use of the design tool for the user.
It is a primary object of the present invention to provide a programming environment and appropriate tools and components therefor that promote greater ease of use than is presently available in typical programming environments.
It is an additional object of the present invention to provide bidirectional ports that can be dynamically set to be either an input or an output port.
It is a further object of the present invention of the present invention to minimize clutter and preserve screen real estate through the use of bidirectional ports.
It is yet another object of the present invention to provide the user with means to utilize such bidirectional ports in an effective, non-intrusive manner.
The above objectives are achieved by utilizing bidirectional ports in association with object-oriented components. The two way or bidirectional ports are first initialized to their two way state. The ports can then dynamically function as either input or output ports based on the manner in which they are used. The components set themselves internally to reflect the actual status of their associated bi-directional ports. When a connection to another component is completed, the connecting component object sends a message to the component at the other end of the connection indicating how its own port is set, to input or output. The message receiving component insures that its connection participating port is set oppositely. If the message receiving component""s connecting port is bidirectional, that port is set opposite to the status of the first connected port. If the message receiving component""s port is unidirectional and as such is in conflict with the status of the first connected port, that is, it is set to xe2x80x9coutputxe2x80x9d or xe2x80x9cinputxe2x80x9d when the first connected port is also set to xe2x80x9coutputxe2x80x9dor xe2x80x9cinputxe2x80x9d respectively, the connection is prohibited and an appropriate error message is displayed